﻿using Microsoft.AspNetCore.Mvc.Filters;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace Surpass.Common.Filter
{
    public class CustomerExceptionFilter : IExceptionFilter
    {
        public void OnException(ExceptionContext context)
        {
            //当前异常未处理
            if (context.ExceptionHandled == false)
            {
                //处理异常
                Exception ex = context.Exception;
                if (ex != null)
                {
                    //获取异常消息
                    string msg = ex.Message;
                    //写日志

                }

                
                
            }

            //异常已经处理成功
            context.ExceptionHandled = true;


        }
    }
}
